<?php
//抽象模板类：
abstract class makeComputer{
     private $type;
     function __construct($type){
         $this->type = $type;
     }
     function procedure(){
         $this->prepareScreen();
         $this->prepareMainboard();
         $this->prepareCPU();
         $this->prepareMemoryBank();
     }
     abstract function prepareScreen();
     abstract function prepareMainboard();
     abstract function prepareCPU();
     abstract function prepareMemoryBank();
}

class makeLenovoComputer extends makeComputer{
     function __construct($type='联想')  {
        parent::__construct($type);
    }
    function prepareScreen(){
        echo "联想屏幕准备完毕";
        echo "<br/>";
    }
    function prepareMainboard(){
        echo "联想主板准备完毕";
        echo "<br/>";
    }
    function prepareCPU(){
        echo "联想CPU准备完毕";
        echo "<br/>";
    }
    function prepareMemoryBank(){
        echo "联想内存条准备完毕";
        echo "<br/>";
    }
}

class makeAsusComputer extends makeComputer{
    function __construct($type='华硕')  {
        parent::__construct($type);
    }
    function prepareScreen(){
        echo "华硕屏幕准备完毕";
        echo "<br/>";
    }
    function prepareMainboard(){
        echo "华硕主板准备完毕";
        echo "<br/>";
    }
    function prepareCPU(){
        echo "华硕CPU准备完毕";
        echo "<br/>";
    }
    function prepareMemoryBank(){
        echo "华硕内存条准备完毕";
        echo "<br/>";
    }
}

//测试
$lenovoComputer = new makeLenovoComputer();
$lenovoComputer->procedure();

